/*
 * Creation : 22/03/2013
 */
package a2012c2.t6.chat.client;

import java.awt.Image;

import javax.swing.ImageIcon;

/**
 * TODO : Description
 * 
 * @author e397496
 * 
 */
public class Icon extends ImageIcon{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String key;
	private String imagePath;

	public Icon(String key, String imagePath) {
		super();
		Image image = new ImageIcon(imagePath).getImage();
		image = image.getScaledInstance(25, 25, Image.SCALE_SMOOTH);
		this.setImage(image);
		this.key = key;
		this.imagePath = imagePath;
	}

	public String getImagePath() {
		return imagePath;
	}

	public void setImagePath(String imagePath) {
		this.imagePath = imagePath;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}
	
	@Override
	public String toString() {
		return key;
	}
}
